<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    //往浏览器设置 名字为aa 值为1 的空间
    localStorage.setItem('ccc', 'xiaoqin');
    localStorage.setItem('bb', "user");
    console.log(window);
    setCookie('aa', 'bb1', 1)
    console.log(document.cookie);
    localStorage.setItem('aa', 1);
    // var aa = localStorage.getItem('aa');
    // console.log(aa);

    function setCookie(cname, cvalue, exdays) {
        var d = new Date();
        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
        var expires = "expires=" + d.toGMTString();
        document.cookie = cname + "=" + cvalue + "; " + expires;
    }
</script>

</html>